//
//  UINavigationControllerEx.swift
//
//
//  Created by S JZ on 2024/9/5.
//

#if os(iOS)
import UIKit

public extension UINavigationController {
    open override var childForStatusBarStyle: UIViewController? { topViewController }
    open override var childForStatusBarHidden: UIViewController? { topViewController }
}

public extension UITabBarController {
    open override var childForStatusBarStyle: UIViewController? { selectedViewController }
    open override var childForStatusBarHidden: UIViewController? { selectedViewController }
}
#endif

//fileprivate var AssociatedStatusBarStyle: String = "AssociatedStatusBarStyle"
//public extension UIViewController {
//    public var isStatusBarDark: Bool {
//        get {
//            (objc_getAssociatedObject(self, &AssociatedStatusBarStyle) as? Bool) ?? false
//        }
//        set {
//            objc_setAssociatedObject(self, &AssociatedStatusBarStyle, newValue, .OBJC_ASSOCIATION_ASSIGN)
//        }
//    }
//    
////    open func preferredStatusBarStyle() -> UIStatusBarStyle {
////        
////    }
//}



